<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>我的信息</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="../../css/oksub.css">
	<script type="text/javascript" src="../../lib/loading/okLoading.js"></script>
</head>
<body>
<div class="ok-body">
	<blockquote class="layui-elem-quote"><p>实名认证（身份认证审核通过后不可更改身份认证信息）</p></blockquote>
	<blockquote class="layui-elem-quote layui-quote-nm">填写基本信息 → 上传证件照 → 等待审核 → 生成证书</blockquote>
	<!--form表单-->
	<blockquote class="layui-elem-quote layui-quote-nm">
      <p><img src="../../images/zs.gif"/></p>
   </blockquote>
	<form class="layui-form layui-form-pane ok-form">
		<div class="layui-form-item">
			<div class="layui-input-block" style="margin-left: 0px;">
				<button class="layui-btn" lay-submit lay-filter="add">下载证书</button>
				<a class="layui-btn" href="user-add.html">点击返回</a>
			</div>
		</div>
	</form>
</div>
<!--js逻辑-->
<script src="../../lib/layui/layui.js"></script>
<script>
	layui.use(["element", "form", "laydate", "okLayer", "okUtils"], function () {
		let form = layui.form;
		let laydate = layui.laydate;
		let okLayer = layui.okLayer;
		let okUtils = layui.okUtils;
		okLoading.close();
		laydate.render({elem: "#birthday", type: "datetime"});

		form.verify({
			birthdayVerify: [/^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))(\s(([01]\d{1})|(2[0123])):([0-5]\d):([0-5]\d))?$/, '日期格式不正确']
		});

		form.on("submit(add)", function (data) {
			okUtils.ajax("/user/addUser", "post", data.field, true).done(function (response) {
				console.log(response);
				okLayer.greenTickMsg("添加成功", function () {
					parent.layer.close(parent.layer.getFrameIndex(window.name));
				});
			}).fail(function (error) {
				console.log(error)
			});
			return false;
		});
	});
</script>
</body>
</html>
